package com.song.mapper;

import com.song.annotation.AutoFill;
import com.song.dto.CategoryPageQueryDTO;
import com.song.entity.Category;
import com.song.enumeration.SqlOperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;


import java.util.List;

@Mapper
public interface CategoryMapper {
    @AutoFill(SqlOperationType.UPDATE)
    Integer updateCategory(Category category);

    @Delete("delete from category where id = #{id}")
    Integer deleteCategory(Long id);

    List<Category> getCategoryPage(CategoryPageQueryDTO categoryPageQueryDTO);

    @AutoFill(SqlOperationType.INSERT)
    Integer addCategory(Category category);
}
